package com.exam.api.modules.metadata.controller;

import com.exam.api.common.web.TinyResponse;
import com.exam.api.modules.metadata.domain.TblMetadata;
import com.exam.api.modules.metadata.service.TblMetadataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author iaa
 * @Description 针对表【tbl_metadata(元数据表)】的数据库操作Controller
 * @Date 2024-10-14 11:54:32
 */
@Tag(name = "(管理端)元数据表模块", description = "元数据表模块")
@RestController
@RequestMapping("/manager/metadata")
@TinyResponse
public class TblMetadataController {

    @Resource
    private TblMetadataService metadataService;

    @Operation(summary = "获取元数据", description = "获取元数据。CAROUSEL_CHART:轮播图")
    @PostMapping
    public TblMetadata getMetadata(@RequestBody @Validated TblMetadata dto) {
        return metadataService.getMetadata(dto);
    }
    // 修改
    @Operation(summary = "修改元数据表")
    @PostMapping("/update")
    public void updateMetadata(@RequestBody TblMetadata dto) {
        metadataService.updateMetadata(dto);
    }

}
